<template>
  <div>
    <el-card shadow="never" class="mb20">
      <level-form @search="handleSearch" ref="LevelForm" />
    </el-card>
    <el-card shadow="never">
      <el-tooltip class="item" content="新增考评等级" effect="dark" placement="top">
        <el-button
          size="small"
          class="fr mb20"
          type="primary"
          @click="handleEdit(false, {})"
          icon="el-icon-plus"
        />
      </el-tooltip>
      <level-table @edit="handleEdit" ref="LevelTable" />
    </el-card>
    <level-modal @refresh="handleSearch" ref="LevelModal" />
  </div>
</template>

<script>
import LevelForm from './LevelForm'
import LevelTable from './LevelTable'
import LevelModal from './LevelModal'
export default {
  components: {
    LevelTable,
    LevelForm,
    LevelModal
  },
  methods: {
    handleSearch(obj = {}) {
      this.$refs.LevelTable.handleGetList(obj)
    },
    handleEdit(bool, obj) {
      this.$refs.LevelModal.edit(bool, obj)
    }
  }
}
</script>
